import request from '@/utils/request'

// 获取员工列表接口
export const getEmployeeList = params => {
  return request({
    url: '/sys/user',
    params
  })
}
// 导出xlsx表格接口批量导出员工
export const exportEmployee = () => {
  return request({
    url: '/sys/user/export',
    responseType: 'blob'
  })
}
// 下载导入员工模板接口
export const downloadEmployee = () => {
  return request({
    url: '/sys/user/import/template',
    responseType: 'blob'
  })
}

// 批量-导入员工(上传excel)
export const uploadExcel = data => {
  return request({
    url: '/sys/user/import',
    method: 'POST',
    data
  })
}
// 删除员工的接口
export const removeEmployee = id => {
  return request({
    url: `/sys/user/${id}`,
    method: 'DELETE'
  })
}
// 调取新增员工的接口
export const additionalEmployee = data => {
  return request({
    url: '/sys/user',
    method: 'POST',
    data
  })
}
// 调取员工详情接口
export const getEmployee = id => {
  return request({
    url: `/sys/user/${id}`
  })
}
// 修改员工接口
export const compileEmployee = data => {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'PUT',
    data
  })
}
// /获取已启用角色列表
export const getRoleList = () => {
  return request({
    url: '/sys/role/list/enabled'
  })
}
// 分配员工角色
export const distributionRole = data => {
  return request({
    url: '/sys/user/assignRoles',
    method: 'PUT',
    data
  })
}
